package hcn.util.validation;/**
 * @Auther: Administrator
 * @Date: 2019/1/24 11:56
 * @Description:
 */

/**
 * @Author: zhusm@bsoft.com.cn
 *
 * @Description: 测试字段
 *
 * @Create: 2019-01-24 11:56
 **/
public class TestFiled {

    @ValidationAnnotaion.NotNull(errorDescription = "姓名不能为空")
    private String name;

    @ValidationAnnotaion(minValue = 0,maxValue = 120,errorDescription = "年龄超出范围",type = InvokeType.NUMBER)
    private int ege;

    @ValidationAnnotaion(minLength = 3,maxLength = 128)
    private String address;

    @ValidationAnnotaion.FiledExpression(filedExpression = "^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$")
    private String email;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getEge() {
        return ege;
    }

    public void setEge(int ege) {
        this.ege = ege;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "TestFiled{" +
                "name='" + name + '\'' +
                ", ege=" + ege +
                ", address='" + address + '\'' +
                ", email='" + email + '\'' +
                '}';
    }

    public static void main(String[] args) throws AnnotaionException {
        TestFiled testFiled = new TestFiled();
        testFiled.setEmail("11");
        testFiled.setName("11");
        testFiled.setEge(11);
        testFiled.setAddress("sadasda");
        System.out.println(testFiled);
        ValidationUtil.validation(testFiled);
    }
}
